<?php
/**
 * @author Inhere
 * @version v1.0
 * Use : this
 * Date : 2015-1-10
 * ServiceProvider.php
 */
namespace ulue\di;


use ulue\core\ioc\Container;
use ulue\core\ioc\InterfaceServiceProvider;

class CoreServiceProvider implements InterfaceServiceProvider
{
    /**
     * 注册一个服务提供容器， CoreServiceProvider
     * @param  Container $container 传入容器
     *
     * @return mixed|void [type]               [description]
     */
    public function register(Container $container)
    {
        $container->set('xxservice',function(Container $container)
        {
            return new xxx;
        })->alias('xxx','xxservice');

    }
}

// $di =ulue\Ioc::build();
// $serviceProvider = $di->registerServiceProvider(new CoreServiceProvider);

// $CoreServiceUser = new CoreServiceUser($serviceProvider);
// $CoreServiceUser->doSomething();